package com.wiim.ui;

import java.net.SocketException;

import com.wiim.handler.CMCmdHandler;
import com.wiim.interfaceapp.IServiceCommandResult;
import com.wiim.nhapnhap.AppGlobal;
import com.wiim.nhapnhap.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

public class HomeFrament extends Fragment implements OnClickListener, IServiceCommandResult{
	private Button btnLogin;
	private Button btnLinkToRegisterScreen;
	private EditText loginEmail;
	private EditText loginPassword;

	@Override
	public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.mail, container, false);
//		btnLogin = (Button) view.findViewById(R.id.btnLogin);
//		btnLinkToRegisterScreen = (Button) view.findViewById(R.id.btnLinkToRegisterScreen);
//		loginEmail = (EditText) view.findViewById(R.id.loginEmail);
//		loginPassword = (EditText) view.findViewById(R.id.loginPassword);
//		init();
		return view;
	}

	private void init() {
		btnLogin.setOnClickListener(this);
		btnLinkToRegisterScreen.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
//		if (v == btnLogin) {
//			// service process
//			Bundle cmdData = new Bundle();
//			cmdData.putString("username", "admin3@gmail.com");
//			cmdData.putString("password", "1");
//			cmdData.putString("deviceid", "9b3d409629ca522b");
//			cmdData.putString("deviceip", "27.64.156.188");
//			cmdData.putString("accounttype", "NATIVE");
//			// onEventReceiver(SCREEN_UI.MAIN);
//			AppGlobal.getInstance(HomeFrament.this).startServiceCmd(CMCmdHandler.COMMAND_VALIDATE_USER, new CMCmdHandler(), cmdData, true);
//		}

	}

	@Override
	public void processCommandResult(int commandCode, Object resultData) {
		Log.v("HAI", "frragment");
		
	}

}
